package cn.sciento.farm.devicemanager.gateway.model.lorawan;

import java.util.Date;
import java.util.List;

/**
 * @author wumu
 * @version V1.0
 * @date 9/20/18
 * @time 5:02 PM
 */
public class DeviceRx {


    /**
     * applicationID : 123
     * applicationName : temperature-sensor
     * deviceName : garden-sensor
     * devEUI : 0202020202020202
     * rxInfo : [{"gatewayID":"0303030303030303","name":"rooftop-gateway","time":"2016-11-25T16:24:37.295915988Z","rssi":-57,"loRaSNR":10,"location":{"latitude":52.3740364,"longitude":4.9144401,"altitude":10.5}}]
     * txInfo : {"frequency":868100000,"dr":5}
     * adr : false
     * fCnt : 10
     * fPort : 5
     * data : ...
     * object : {"temperatureSensor":{"1":25},"humiditySensor":{"1":32}}
     */

    private String applicationID;
    private String applicationName;
    private String deviceName;
    private String devEUI;
    private TxInfoBean txInfo;
    private Boolean adr;
    private Integer fCnt;
    private Integer fPort;
    private String data;
    private Object object;
    private List<RxInfoBean> rxInfo;

    public String getApplicationID() {
        return applicationID;
    }

    public void setApplicationID(String applicationID) {
        this.applicationID = applicationID;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDevEUI() {
        return devEUI;
    }

    public void setDevEUI(String devEUI) {
        this.devEUI = devEUI;
    }

    public TxInfoBean getTxInfo() {
        return txInfo;
    }

    public void setTxInfo(TxInfoBean txInfo) {
        this.txInfo = txInfo;
    }

    public Boolean getAdr() {
        return adr;
    }

    public void setAdr(Boolean adr) {
        this.adr = adr;
    }

    public Integer getfCnt() {
        return fCnt;
    }

    public void setfCnt(Integer fCnt) {
        this.fCnt = fCnt;
    }

    public Integer getfPort() {
        return fPort;
    }

    public void setfPort(Integer fPort) {
        this.fPort = fPort;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public List<RxInfoBean> getRxInfo() {
        return rxInfo;
    }

    public void setRxInfo(List<RxInfoBean> rxInfo) {
        this.rxInfo = rxInfo;
    }

    public static class TxInfoBean {
        /**
         * frequency : 868100000
         * dr : 5
         */

        private Integer frequency;
        private Integer dr;

        public Integer getFrequency() {
            return frequency;
        }

        public void setFrequency(Integer frequency) {
            this.frequency = frequency;
        }

        public Integer getDr() {
            return dr;
        }

        public void setDr(Integer dr) {
            this.dr = dr;
        }
    }

    public static class RxInfoBean {
        /**
         * gatewayID : 0303030303030303
         * name : rooftop-gateway
         * time : 2016-11-25T16:24:37.295915988Z
         * rssi : -57
         * loRaSNR : 10
         * location : {"latitude":52.3740364,"longitude":4.9144401,"altitude":10.5}
         */

        private String gatewayID;
        private String name;
        private Date time;
        private Integer rssi;
        private Integer loRaSNR;
        private LocationBean location;

        public String getGatewayID() {
            return gatewayID;
        }

        public void setGatewayID(String gatewayID) {
            this.gatewayID = gatewayID;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Date getTime() {
            return time;
        }

        public void setTime(Date time) {
            this.time = time;
        }

        public Integer getRssi() {
            return rssi;
        }

        public void setRssi(Integer rssi) {
            this.rssi = rssi;
        }

        public Integer getLoRaSNR() {
            return loRaSNR;
        }

        public void setLoRaSNR(Integer loRaSNR) {
            this.loRaSNR = loRaSNR;
        }

        public LocationBean getLocation() {
            return location;
        }

        public void setLocation(LocationBean location) {
            this.location = location;
        }


        public static class LocationBean {
            /**
             * latitude : 52.3740364
             * longitude : 4.9144401
             * altitude : 10.5
             */

            private Double latitude;
            private Double longitude;
            private Double altitude;

            public Double getLatitude() {
                return latitude;
            }

            public void setLatitude(Double latitude) {
                this.latitude = latitude;
            }

            public Double getLongitude() {
                return longitude;
            }

            public void setLongitude(Double longitude) {
                this.longitude = longitude;
            }

            public Double getAltitude() {
                return altitude;
            }

            public void setAltitude(Double altitude) {
                this.altitude = altitude;
            }
        }
    }

    @Override
    public String toString() {
        return "DeviceRx{" +
                "applicationID='" + applicationID + '\'' +
                ", applicationName='" + applicationName + '\'' +
                ", deviceName='" + deviceName + '\'' +
                ", devEUI='" + devEUI + '\'' +
                ", txInfo=" + txInfo +
                ", adr=" + adr +
                ", fCnt=" + fCnt +
                ", fPort=" + fPort +
                ", data='" + data + '\'' +
                ", object=" + object +
                ", rxInfo=" + rxInfo +
                '}';
    }
}
